public class Product {
    private String title; 
    private Double weight; 
    private String description; 
    public Product(String title, Double weight, String description) {
        this.title = title;
        this.weight = weight;
        this.description = description;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public void setWeight(Double weight) {
        this.weight = weight;
    }
    public void setDescription(String description) {
        this.description = description;
    }
}

public class OrderDetail {
    private Integer quantity; 
    private Product theProduct; 
    public OrderDetail(Integer quantity, Product theProduct) {
        this.quantity = quantity;
        this.theProduct = theProduct;
    }
       public void setQuantity(Integer quantity) {
        if (quantity <= 0) {
            throw new IllegalArgumentException("商品数量必须为正整数");
        }
        this.quantity = quantity;
    }
    public void setTheProduct(Product theProduct) {
        this.theProduct = theProduct;
    }
}

public abstract class Payment {
    private Double amount; 
    public Payment(Double amount) {
        this.amount = amount;
    }
        public void setAmount(Double amount) {
        this.amount = amount;
    }
}

public class Credit extends Payment {
    private String number; 
    private String type; 
    public Credit(Double amount, String number, String type) {
        super(amount);
        this.number = number;
        this.type = type;
    }
       public void setNumber(String number) {
        this.number = number;
    }
    public void setType(String type) {
        this.type = type;
    }
   }

public class Cash extends Payment {
    private Double cashTendered; 
    public Cash(Double amount, Double cashTendered) {
        super(amount);
        this.cashTendered = cashTendered;
    }

public class AliPay extends Payment {
    private String number; 
    public AliPay(Double amount, String number) {
        super(amount);
        this.number = number;
    }
       public void setNumber(String number) {
        this.number = number;
    }
}

public class WeixinPay extends Payment {
    private String number; 
    public WeixinPay(Double amount, String number) {
        super(amount);
        this.number = number;
    }
        public void setNumber(String number) {
        this.number = number;
    }
}

public class WireTransfer extends Payment {
    private String bankID; 
    private String bankName;
    public WireTransfer(Double amount, String bankID, String bankName) {
        super(amount);
        this.bankID = bankID;
        this.bankName = bankName;
    }
       public void setBankID(String bankID) {
        this.bankID = bankID;
    }
       public void setBankName(String bankName) {
        this.bankName = bankName;
    }
}

public class Order {
    private OrderStatus status; 
    private List<OrderDetail> orderDetails = new ArrayList<>();
    private Payment payment;
       public Order(OrderStatus status) {
        this.status = status;
    }
    public void addOrderDetail(OrderDetail orderDetail) {
        if (orderDetail != null && !orderDetails.contains(orderDetail)) {
            orderDetails.add(orderDetail);
        }
    }
    public void bindPayment(Payment payment) {
        this.payment = payment;
        this.status = OrderStatus.PAID;
    }
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }
    public void setStatus(OrderStatus status) {
        this.status = status;
    }
}

public class Customer {
    private String name; 
    private String deliveryAddress; 
    private List<Order> theOrders = new ArrayList<>();
    public Customer(String name, String deliveryAddress, ) {
        this.name = name;
        this.deliveryAddress = deliveryAddress;
    }
    public void addOrder(Order order) {
        if (order != null && !theOrders.contains(order)) {
            theOrders.add(order);
        }
    }
    public void removeOrder(Order order) {
        theOrders.remove(order);
    }
    public void setName(String name) {
        this.name = name;
    }
    public void setDeliveryAddress(String deliveryAddress) {
        this.deliveryAddress = deliveryAddress;
    }
}